{% extends 'layout/base.html' %}
{% load static %}
{% block left_content %}
<div class="layui-container" style="margin-top: 20px;">
  <div class="fly-panel fly-panel-user" pad20>
    <div class="layui-tab layui-tab-brief" lay-filter="user">
      <ul class="layui-tab-title" id="LAY_mine">
        <li class="layui-this" lay-id="info">我的资料</li>
        <li lay-id="avatar">头像</li>
        <li lay-id="info">修改密码</li>
      </ul>
      <div class="layui-tab-content" style="padding: 20px 0;">
        <div class="layui-form layui-form-pane layui-tab-item layui-show">
          <form class="layui-form" action="#">
            {% csrf_token %}
            <div class="layui-form-item">


              <label for="L_username" class="layui-form-label">昵称</label>
              <div class="layui-input-inline">
                <input type="text" id="L_username"  maxlength="10"  name="username" required lay-verify="required" autocomplete="off"
                  value="{{request.user.username}}" class="layui-input">
              </div>
              <div class="layui-inline">
                <div class="layui-input-inline">
                  {% if request.user.sex == 'male' %}
                  <input type="radio" name="sex" value="male" checked title="男">
                  <input type="radio" name="sex" value="femle" title="女">
                  {% else %}
                  <input type="radio" name="sex" value="male" title="男">
                  <input type="radio" name="sex" value="femle" checked title="女">
                  {% endif %}
                </div>
              </div>
            </div>

            <div class="layui-form-item">
              <label for="L_email" class="layui-form-label">邮箱</label>
              <div class="layui-input-inline">
                <input type="text" id="L_email" disabled="true" value="{{request.user.email}}"   class="layui-input">
              </div>
                <div class="layui-form-mid layui-word-aux">邮箱不可修改</div>
            </div>

            <div class="layui-form-item layui-form-text">
              <label for="L_sign" class="layui-form-label">签名</label>
              <div class="layui-input-block">
                <textarea placeholder="给自己定个小目标吧" id="L_sign" name="qianming" autocomplete="off"
                  class="layui-textarea" style="height: 80px;">{{request.user.qianming}}</textarea>
              </div>
            </div>
            <div class="layui-form-item">
              <button class="layui-btn" key="set-mine" lay-filter="setinfo" lay-submit>确认修改</button>
            </div>
          </form>
        </div>

        <div class="layui-form layui-form-pane layui-tab-item">
          <div class="layui-form-item">
            <div class="avatar-add">
              <div class="layui-upload">
                <button type="button" class="layui-btn upload-img" id="upload"><i
                    class="layui-icon">&#xe67c;</i>上传头像</button>
                <img id='preview' src="{{request.user.avatar}}">
                <span class="loading"></span>
              </div>
              <p>建议尺寸168*168，支持jpg、png、gif，最大不能超过200KB</p>
            </div>
          </div>
        </div>

        <div class="layui-form layui-form-pane layui-tab-item">
          <form action='#'>
            {% csrf_token %}
            <div class="layui-form-item">
              <label for="L_pass" class="layui-form-label">原密码</label>
              <div class="layui-input-inline">
                <input type="password" id="L_pass" name="oldpassword" required lay-verify="required" autocomplete="off"
                  class="layui-input">
              </div>
            </div>

            <div class="layui-form-item">
              <label for="L_pass" class="layui-form-label">新密码</label>
              <div class="layui-input-inline">
                <input type="password" id="L_pass" name="password" required lay-verify="required" autocomplete="off"
                  class="layui-input">
              </div>
            </div>

            <div class="layui-form-item">
              <label for="L_repass" class="layui-form-label">确认密码</label>
              <div class="layui-input-inline">
                <input type="password" id="L_repass" name="repassword" required lay-verify="required" autocomplete="off"
                  class="layui-input">
              </div>
            </div>

            <div class="layui-form-item">
              <button class="layui-btn" key="set-mine" lay-filter="setpass" lay-submit>确认修改</button>
            </div>
          </form>
        </div>

      </div>
    </div>
  </div>
</div>
</div>
{% endblock %}
{% block script %}
<script src="{% static 'index/js/set.js' %}"></script>
{% endblock %}